package com.one.controller;

import com.one.annotation.RequestPermission;
import com.one.annotation.RequestUser;
import com.one.service.CommonOrderService;
import com.one.util.RequestReturn;
import com.one.vo.ProductParamVo;
import com.one.vo.UserVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Create on 2022-01-20
 * <p>
 * Author: LiangWei
 * <p>
 * Description: 普通下单接口controller层
 **/
@RestController
public class CommonOrderController {


    @Autowired
    private CommonOrderService commonOrderService;


    @PostMapping("/commonOrder")
    @RequestPermission
    public RequestReturn<String> commonOrder(@RequestUser UserVo userVo,@RequestBody List<ProductParamVo> productParamVoList){
       return commonOrderService.createCommonTradeOrder(userVo.getUserId(),productParamVoList);
    }
}
